let utils = data["utils"];
let STUtil = data["STUtil"];
let Node = data["Node"];
let SplayTree = data["SplayTree"];
let isInBbox = data["isInBbox"];
let getBboxOverlap = data["getBboxOverlap"];
let cmp = data["cmp"];
let rounder = data["rounder"];
let geomIn = data["geomIn"];
let geomOut = data["geomOut"];
let operation = data["operation"];
let Segment = data["Segment"];
let SweepEvent = data["SweepEvent"];
let SweepLine = data["SweepLine"];
let polygonClipping = data["polygonClipping"];
let DynamicLabel = data["DynamicLabel"];
console.log("16DynamicLabel04");
utils.extend(DynamicLabel.prototype, { getLabels: function (currentCenterLng, currentCenterLat, zoom, width, height, polygons) { var features = polygons.features, geoFeatures = []; for (let index = 0; index < features.length; index++) { const element = features[index]; var feature = { area_id: element.properties.adcode, name: element.properties.name }; "MultiPolygon" == element.geometry.type && (feature.geo = element), geoFeatures.push(feature) } var extent = this.getExtent(currentCenterLng, currentCenterLat, zoom, width, height), extentPoly01 = { type: "Feature", properties: {}, geometry: { type: "Polygon", coordinates: [[[extent[0], extent[1]], [extent[2], extent[1]], [extent[2], extent[3]], [extent[0], extent[3]], [extent[0], extent[1]]]] } }, intersectFeatures = []; for (let index = 0; index < geoFeatures.length; index++) { const element = geoFeatures[index]; var bbox = this.bbox(element.geo); this.is_rect_intersect(bbox, extent) && intersectFeatures.push(element) } var intersectFeaturesResult = [], bbox = extent; for (let index = 0; index < intersectFeatures.length; index++) { const element = intersectFeatures[index]; var clipped = this.intersect(element.geo, extentPoly01); if (null != clipped) { element.clipGeo = clipped; var centroid = this.center(clipped); element.clipGeo_center = centroid.geometry.coordinates; var maxsubPolygon = clipped; if ("MultiPolygon" == clipped.geometry.type) { var coordinates; if (maxsubPolygon = { type: "Feature", properties: {}, geometry: { type: "Polygon", coordinates: (coordinates = clipped.geometry.coordinates)[0] } }, coordinates.length > 1) for (let coordIndex = 1; coordIndex < coordinates.length; coordIndex++) { const curCoords = coordinates[coordIndex]; if (curCoords.length > 0) { var curMaxArea = this.area(maxsubPolygon), cursubPolygon = { type: "Feature", properties: {}, geometry: { type: "Polygon", coordinates: curCoords } }, curArea; this.area(cursubPolygon) > curMaxArea && (maxsubPolygon = cursubPolygon) } } centroid = this.center(maxsubPolygon), element.clipGeo_center = centroid.geometry.coordinates } var coordinates, flatCoordinates = []; if ((coordinates = maxsubPolygon.geometry.coordinates).length > 0) for (let index = 0; index < coordinates[0].length; index++) { const corrdS = coordinates[0][index]; flatCoordinates.push(corrdS[0]), flatCoordinates.push(corrdS[1]) } var centroidCoordinates = this.getInteriorPointOfArray(flatCoordinates, 0, [flatCoordinates.length], 2, element.clipGeo_center, 0, null); element.clipGeo_center = centroidCoordinates, intersectFeaturesResult.push(element) } } return console.log("相交要素：", intersectFeatures), intersectFeaturesResult } });

return {
  "utils": utils,
  "STUtil": STUtil,
  "Node": Node,
  "SplayTree": SplayTree,
  "isInBbox": isInBbox,
  "getBboxOverlap": getBboxOverlap,
  "cmp": cmp,
  "rounder": rounder,
  "geomIn": geomIn,
  "geomOut": geomOut,
  "operation": operation,
  "Segment": Segment,
  "SweepEvent": SweepEvent,
  "SweepLine": SweepLine,
  "polygonClipping": polygonClipping,
  "DynamicLabel": DynamicLabel
}